package com.heima.user.controller.v1;

import com.heima.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AppLoginDto;
import com.heima.user.service.IApUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.Map;

@RestController
@RequestMapping("/api/v1/login")
public class ApLoginController {

    @Autowired
    private IApUserService userService;

    /**
     * App用户登录功能
     */
    @PostMapping("/login_auth")
    public ResponseResult<Map<String,Object>> login(@RequestBody AppLoginDto dto){
        Map<String,Object> map = userService.login(dto);
        return ResponseResult.ok(map);
    }
}
